<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <title>快速搜索</title>
    <link rel="stylesheet" href="./country.css">
</head>
<body>

<header class="fixed" style="background: #fff">
    <div class="header" style="background: #fff">
        <div style="width: 10%;height: 100%;float: left">
           <img style="width: 50%; margin-top: 40%" src="./images/search.png">
        </div>
        <div style="width: 90%;float: left">
            <input id="searchCityName" style="width: 100%;height: 100%;border: #fff" type="text" placeholder="Search" />
        </div>

    </div>
</header>
<div id="letter" ></div>
<div class="sort_box">
   
        <div class="sort_list" style="background: #fff">
            <div class="num_logo">
                <img src="./images/068.png" alt="">
            </div>
            <div class="num_name">第二</div>
            <input type="hidden" class="searchs" data-Eglish="dier" data-chinese="第二">
        </div>
         <div class="sort_list" style="background: #fff">
            <div class="num_logo">
                <img src="./images/068.png" alt="">
            </div>
            <div class="num_name">aaa</div>
            
            <input type="hidden" class="searchs" data-Eglish="aaa" data-chinese="啊">
        </div>
         <div class="sort_list" style="background: #fff">
            <div class="num_logo">
                <img src="./images/068.png" alt="">
            </div>
            <div class="num_name">ccc</div>
     
            <input type="hidden" class="searchs" data-Eglish="ccc" data-chinese="吃">
        </div>
         <div class="sort_list" style="background: #fff">
            <div class="num_logo">
                <img src="./images/068.png" alt="">
            </div>
            <div class="num_name">bbbb</div>
       
            <input type="hidden" class="searchs" data-Eglish="bbb" data-chinese="不">
        </div>
          <div class="sort_list" style="background: #fff">
            <div class="num_logo">
                <img src="./images/068.png" alt="">
            </div>
            <div class="num_name">ccc</div>
     
            <input type="hidden" class="searchs" data-Eglish="ccc" data-chinese="吃">
        </div>
   
</div>
<div class="initials">
    <ul>
        <li><img src="./images/068.png"></li>
    </ul>

</div>

<script type="text/javascript" src="./jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="./country.js"></script>
<script type="text/javascript" src="./countrysort.js"></script>
<script>

    function searchCity() {
        var searchCityName = $("#searchCityName").val();
        if (searchCityName == "") {
            $('.sort_letter').show();
            $(".sort_list").show();
        } else {
            $('.sort_letter').hide();
            $(".searchs").each(
                function() {
                    var English = $(this).attr("data-Eglish");
                    var chinese = $(this).attr("data-chinese");
                    if (English.indexOf(searchCityName) != -1
                        || chinese.indexOf(searchCityName) != -1) {

                        $(this).parent().show();
                    } else {
                        $(this).parent().hide();
                    }
                });
        }
    }
    $('#searchCityName').bind('input propertychange', function() {
        // console.log(1);
        searchCity();
    });
    $('.sort_list').click(function () {
        var val =new Object();
        val.state = $(this).attr('data-state');
        val.countryid = $(this).attr('data-countryid');
        val.Eglish = $(this).attr('data-Eglish');
        val.chinese = $(this).attr('data-chinese');
        $.ajax({
            url:'{:url("session_set")}',
            data:val,
            type:"POST",
            dataType:"JSON",
            cache:false,
            success:function (data) {
                history.go(-1);
            }
        })
    })
</script>
</body>
</html>